package com.healthcloud.service;

import java.util.List;

import com.healthcloud.entity.PatientSNEntity;
import com.healthcloud.exception.ReturnException;
import com.healthcloud.utils.PageParam;

/**
 * 
 * @author zj
 * 2017年7月20日 下午4:43:00
 */
public interface PatientSNService {
	
	/**
	 * 根据sn号获取绑定数据
	 * @param sn
	 * @return
	 */
	PatientSNEntity findBySn(String sn);

	/**
	 * 查找所有绑定记录
	 * @param entity
	 * @return
	 */
	List<PatientSNEntity> findByEntityAll(PatientSNEntity entity);
	
	/**
	 * 保存
	 * @param entity
	 * @return
	 */
	int save(PatientSNEntity entity);

	/**
	 * 修改
	 * @param patientSNEntity
	 * @return
	 */
	int update(PatientSNEntity entity);
	
	/**
	 * 修改绑定
	 * @param patientSNEntity
	 * @throws ReturnException 
	 */
	void updateBinding(PatientSNEntity patientSNEntity, PatientSNEntity oldPatientSNEntity) throws ReturnException;
	
	/**
	 * 解绑
	 * @param oldPatientSNEntity
	 * @return 
	 * @throws ReturnException 
	 */
	PatientSNEntity relieve(PatientSNEntity patientSNEntity) throws ReturnException;

	/**
	 * 绑定
	 * @param patientSNEntity
	 * @throws ReturnException 
	 */
	void binding(PatientSNEntity patientSNEntity) throws ReturnException;

	/**
	 * 查找所有绑定记录
	 * @param entity
	 * @return
	 */
	List<PatientSNEntity> search(PatientSNEntity entity, PageParam pageParam);

	/**
	 * 查找所有绑定记录数量
	 * @param entity
	 * @return
	 */
	int count(PatientSNEntity entity);

}
